Skip to content

Initialize standard JSON pair_pos sentinel#12

Closed
SRO-SA wants to merge 1 commit into
masterfrom
fix/issue-3-standard-pair-pos-init
Closed

Initialize standard JSON pair_pos sentinel#12
SRO-SA wants to merge 1 commit into
masterfrom
fix/issue-3-standard-pair-pos-init

Conversation

@SRO-SA

@SRO-SA SRO-SA commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

Fixes #3

Summary:

  • Zero-initializes the pinned host result buffer in parse_standard_json.
  • Explicitly initializes the artificial root/sentinel slot shared by structural[result_size + 1] and pair_pos[0].
  • Preserves the existing parser layout where real structural data starts at structural[1] and real pair_pos data starts at pair_pos[1].

Testing:

  • I could not run CUDA or compute-sanitizer locally because my laptop does not have CUDA access.
  • I reviewed the standard JSON result-buffer layout manually.
  • Please rerun the initcheck reproducer from the issue to confirm the uninitialized read is resolved.

Note:

  • I kept the existing +2 pair_pos copy offset because the code reserve pair_pos[0] for the artificial root/sentinel entry. Moving the copy destination to +1 would shift real pair_pos entries and may break iterator semantics.

@ashkanvg

Copy link
Copy Markdown
Collaborator

Closing as superseded by #15. PR #12 correctly identified the host sentinel concern, but #15 also initializes the device padding read by depth_init_MathAPI and avoids clearing the full host result buffer. PR #15 passed A100 initcheck, output/hash equivalence, iterator, and performance validation. Thank you for the contribution.

@ashkanvg ashkanvg closed this Jul 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Uninitialized memory read in depth_init_MathAPI from pair_pos buffer off-by-one

2 participants